home *** CD-ROM | disk | FTP | other *** search
- % $Id: gr_header.ps,v 2.3 89/09/20 17:01:32 mbp Exp $
- %
- % gr_header.ps: PostScript header file
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1989 by Mark B. Phillips %
- % %
- % Permission to use, copy, modify, and distribute this software and %
- % its documentation for any purpose and without fee is hereby granted, %
- % provided that the above copyright notice appear in all copies and %
- % that both that copyright notice and this permission notice appear in %
- % supporting documentation, and that the name of Mark B. Phillips or %
- % the University of Maryland not be used in advertising or publicity %
- % pertaining to distribution of the software without specific, written %
- % prior permission. This software is provided "as is" without express %
- % or implied warranty. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % This file must be preceeded by PostScript lines of the following
- % form, where lines enclosed in [ ] are optional (the [ ] are NOT
- % part of the lines):
- %
- % %!
- % /CanvasWidth WIDTH def
- % /CanvasHeight HEIGHT def
- % /LabelPresent LABELFLAG def
- % [ /Label (LABEL) def ]
- % /TimePresent TIMEFLAG def
- % [ /Time (TIME) def ]
- % /LogoPresent LOGOFLAG def
- % [ /Logo (LOGO) def ]
- %
- % where
- % WIDTH = width (in pixels) of drawing area
- % HEIGHT = hieght (in pixels) of drawing area
- % LABELFLAG = 0 or 1; if 0, the /Label line
- % may be omitted; if 1, the /Label line is required
- % LABEL = string to use as picture label
- % LOGOLFLAG = 0 or 1; if 0, the /Logo line
- % may be omitted; if 1, the /Logo line is required
- % LOGO = string to use as program logo
- % TIMEFLAG = 0 or 1; if 0, the /Time line
- % may be omitted; if 1, the /Time line is required
- % TIME = string containing current date and time
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- %
- % Set up picture coordinate system and drawing defs
- %
-
- /CanvasAspectRatio CanvasWidth CanvasHeight div def
- /inch {72 mul} def
- /PaperWidth 8.5 inch def
- /PaperHeight 11.0 inch def
- /LeftMargin 1.0 inch def
- /RightMargin 1.0 inch def
- /PictureWidth PaperWidth LeftMargin RightMargin add sub def
- /PictureHeight CanvasAspectRatio PictureWidth mul def
- /Xoffset LeftMargin def
- /Yoffset PaperHeight PictureHeight sub 2 div def
- /xScaleFactor PictureWidth CanvasHeight div def
- /yScaleFactor PictureHeight CanvasWidth div def
- /LabelPointSize 16 def
- /TimePointSize 12 def
- /LogoPointSize 16 def
- %
- % Do the logo, if there is one
- %
-
- 1 LogoPresent eq
- {
- gsave
- /Times-BoldItalic findfont
- LogoPointSize scalefont setfont
- % LogoPointSize 2 mul
- % LogoPointSize 1.5 mul
- .5 inch
- .5 inch
- translate
- 90 rotate
- 0 0 moveto
- Logo show
- grestore
- } if
-
- %
- % Do the time stamp, if there is one
- %
-
- 1 TimePresent eq
- {
- gsave
- /Times-Roman findfont
- TimePointSize scalefont setfont
- .5 inch
- PaperHeight .5 inch sub
- Time stringwidth pop sub
- % y-coord of translation is
- % PaperHeight - .5 inch - <width of Time string>
- translate
- 90 rotate
- 0 0 moveto
- Time show
- grestore
- } if
-
- /ThinlineWidth 1.0 yScaleFactor div 0.01 mul def
- /ThicklineWidth 1.0 yScaleFactor div def
- /PointRadius 1.0 yScaleFactor div def
- /m {exch newpath moveto} def
- /d {exch lineto currentpoint stroke moveto} def
- /a {gsave newpath
- /ang2 exch def /ang1 exch def /r exch def
- /xc exch def /yc exch def
- xc yc translate
- 0 0 r ang1 ang2 arc stroke grestore} def
- /c {gsave newpath /r exch def /x exch def /y exch def
- x y r 0 360 arc stroke grestore} def
- /di {gsave newpath /r exch def /y exch def /x exch def
- x y r 0 360 arc fill grestore} def
- /p {currentpoint PointRadius di} def
- /DoBox {0 0 moveto
- 0 CanvasWidth lineto
- CanvasHeight CanvasWidth lineto
- CanvasHeight 0 lineto
- 0 0 lineto } def
- Xoffset Yoffset translate
- xScaleFactor yScaleFactor scale
-
- %
- % Do the picture label, if there is one
- %
-
- 1 LabelPresent eq
- {
- gsave
- /Times-Roman findfont
- LabelPointSize scalefont setfont
- Label stringwidth pop
- /LabelWidth exch def
- CanvasHeight LabelPointSize 1.5 mul add
- CanvasWidth 2 div LabelWidth 2 div sub
- translate
- 90 rotate
- 0 0 moveto
- Label show
- grestore
- } if
-
- %
- % Draw outline of box and clip subsequent graphics to this box
- %
- ThicklineWidth setlinewidth
- newpath DoBox stroke
- newpath DoBox clip
- ThinlineWidth setlinewidth
- %
- % end of header
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-